#pragma once
#include<iostream>
#include<vector>
using namespace std;

namespace x
{
	template<size_t N>
	class bit_set
	{
	public:
		bit_set()
		{
			_bs.resize(N / 32 + 1);
		}

		void set(size_t x)
		{
			int i = x / 32;
			int j = x % 32;

			_bs[i] |= (1 << j);
		}

		void reset(size_t x)
		{
			int i = x / 32;
			int j = x % 32;

			_bs[i] &= (~(1 << j));
		}

		bool check(size_t x)
		{
			int i = x / 32;
			int j = x % 32;

			return _bs[i] & (1 << j);
		}
	private:
		vector<size_t> _bs;
	};
}
